/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.*;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "SERVICE_DIVISION_CONFIG", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ServiceDivisionConfig.findAll", query = "SELECT s FROM ServiceDivisionConfig s"),
    @NamedQuery(name = "ServiceDivisionConfig.findById", query = "SELECT s FROM ServiceDivisionConfig s WHERE s.id = :id"),
    @NamedQuery(name = "ServiceDivisionConfig.findByFieldName", query = "SELECT s FROM ServiceDivisionConfig s WHERE s.fieldName = :fieldName"),
    @NamedQuery(name = "ServiceDivisionConfig.findByValue", query = "SELECT s FROM ServiceDivisionConfig s WHERE s.value = :value"),
    @NamedQuery(name = "ServiceDivisionConfig.findByDescription", query = "SELECT s FROM ServiceDivisionConfig s WHERE s.description = :description")})
public class ServiceDivisionConfig implements Serializable {

    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private BigDecimal id;
    @Size(max = 100)
    @Column(name = "FIELD_NAME")
    private String fieldName;
    @Size(max = 100)
    @Column(name = "VALUE")
    private String value;
    @Size(max = 1000)
    @Column(name = "DESCRIPTION")
    private String description;

    public ServiceDivisionConfig() {
    }

    public ServiceDivisionConfig(BigDecimal id) {
        this.id = id;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ServiceDivisionConfig)) {
            return false;
        }
        ServiceDivisionConfig other = (ServiceDivisionConfig) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.ServiceDivisionConfig[ id=" + id + " ]";
    }
}
